﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Resources;
using Microsoft.Xna.Framework.Audio;
using System.Windows.Media.Effects;
using System.Windows.Browser;
using Sanctuary.Core;


namespace Sanctuary
{
    

    public delegate void StartSeledtedEventHandler();

    public partial class IntroScreen : UserControl
    {
        public IntroScreen()
        {
            InitializeComponent();
            HtmlPage.Plugin.Focus();
        }

        
        private SoundEffect effect;
        private SoundEffectInstance effectInstance;

        public event StartSeledtedEventHandler StartSelected;

        private void TextBlock_MouseEnter(object sender, MouseEventArgs e)
        {
            //textStart.Effect = new DropShadowEffect{ Color=Colors.Black};
        }

        private void textStart_MouseLeave(object sender, MouseEventArgs e)
        {
            //textStart.Effect = new DropShadowEffect { Color = Colors.White };
        }


        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            //LayoutRoot.Children.Insert(0, ImageFiles.IntroImage);

            // Create the SoundEffect from the Stream 
            //effect = SoundEffect.FromStream(SoundFiles.Intro);

            //effectInstance = effect.CreateInstance();
            //effectInstance.IsLooped = true;
            //effectInstance.Play();
        }

        private void UserControl_Unloaded(object sender, RoutedEventArgs e)
        {
            //effectInstance.Stop();
        }

        private void textStart_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            if (StartSelected != null)
            {
                StartSelected();
            }
        }
    }
}
